<!DOCTYPE html>
<html>

<head>
    <title>喵喵喵~~~~</title>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    <meta name='ad.size' content='width=320,height=480' />
    <style>
        html,
        body {
            height: 100%;
            padding: 0;
            margin: 0;
        }

        body {
            background-color: black;
            background-size: auto 100%;
            background-repeat: no-repeat;
            background-position: center center;
            overflow: hidden;
        }

        video {

            padding: 0;
            margin: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 111;
            display: none;
        }
    </style>
    __initEvent
    <script>
        var currOrient = -1;

        function handleSize() {
            var vid = document.getElementById('vid');
            var vidSource = document.getElementById('vidsource');

            //竖屏
            if (window.innerWidth < window.innerHeight && currOrient != 0 && window.videos[0]) {
                currOrient = 0;

                //刷新css
                resetCSS();

                //刷新视频源
                vidSource && vidSource.setAttribute('src', window.videos[0]);
                vid.load();
                vid.play();

                //适配处理
                var aspectRatio = window.innerHeight / window.innerWidth;
                if (aspectRatio > 1.77777) {

                    var targetHeight = window.innerWidth * 16 / 9;
                    var heightDiff = window.innerHeight - targetHeight;

                    vid.style.paddingTop = String(heightDiff / window.innerHeight * 100) + '%';
                    vid.style.paddingBottom = String(heightDiff / window.innerHeight * 100) + '%';
                    vid.style.height = String(100 - ((heightDiff / window.innerHeight) * 100)) + '%';


                    document.body.style.backgroundSize = '133% auto';
                }
                else {
                    document.body.style.backgroundSize = 'auto 100%';
                    vid.style.paddingTop = 0;
                    vid.style.paddingBottom = 0;
                    vid.style.height = '100%';
                }


            }//横屏
            else if (window.innerWidth > window.innerHeight && currOrient != 1 && window.videos[1]) {
                currOrient = 1;

                //刷新css
                resetCSS();
                
                //刷新视频源
                vidSource.setAttribute('src', window.videos[1]);
                vid.load();
                vid.play();

                //适配处理
                var aspectRatio = window.innerWidth / window.innerHeight;
                if (aspectRatio > 1.77777) {
                    var targetWidth = window.innerHeight * 16 / 9;
                    var widthDiff = window.innerWidth - targetWidth;

                    vid.style.paddingLeft = String(widthDiff / window.innerWidth * 100 * 0.5) + '%';
                    vid.style.paddingRight = String(widthDiff / window.innerWidth * 100 * 0.5) + '%';
                    vid.style.width = String(100 - ((widthDiff / window.innerWidth) * 100)) + '%';

                    document.body.style.backgroundSize = 'auto 133%';
                }
                else {
                    document.body.style.backgroundSize = '100% auto';
                    vid.style.paddingLeft = 0;
                    vid.style.paddingRight = 0;
                    vid.style.width = '100%';
                }
            }
        }


        function showVid() {
            var vid = document.getElementById('vid');
            vid.style.display = 'initial';
            window.setInterval(handleSize, 17);
        }

        function resetCSS() {
            var vid = document.getElementById('vid');
            var vidSource = document.getElementById('vidsource');

            vid.style.paddingTop = 0;
            vid.style.paddingBottom = 0;
            vid.style.paddingLeft = 0;
            vid.style.paddingRight = 0;
            vid.style.height = '100%';
            vid.style.width = '100%';
        }

        function ptInRect(rect, pt) {
            return pt.x >= rect.minX && pt.x <= rect.maxX && pt.y >= rect.minY && pt.y <= rect.maxY;
        }

        //点击事件
        function clickthrough(event) {
            event.preventDefault();

            //点击全屏立即跳转
            console.log('%cInstall', 'color:#F4A792;background:#464646;padding:3px 6px;');
            __installEvent


            //指定区域 点击才能生效
            // let touches = event.touches;
            // let firstTouch = touches[0];
            // let x = firstTouch.clientX;
            // let y = firstTouch.clientY;
            // let pt = { x: x, y: y };

            // for (let c of window.p_cur.children) {
            //     let trigger = currOrient == 0 ? c.trigger_v : c.trigger_h;
            //     if (trigger != null) {

            //         let x = trigger[0] / window.res.frame_size.min * window.innerWidth;
            //         let w = trigger[2] / window.res.frame_size.min * window.innerWidth;
            //         let y = trigger[1] / window.res.frame_size.max * window.innerHeight;
            //         let h = trigger[3] / window.res.frame_size.max * window.innerHeight;

            //         let rect = {
            //             minX: x,
            //             maxX: x + w,
            //             minY: y,
            //             maxY: y + h
            //         };

            //         let isClick = ptInRect(rect, pt);
            //         if (isClick) {

            //             window.Geek7_InstallMark;
            //         }
            //     }

            // }

        }

        window.onresize = function (event) {

            handleSize();
        };



        function gameStart() {

        }
        function gameClose() {

        }
    </script>
</head>

<body ontouchstart='clickthrough(event)' onmousedown='clickthrough(event)' style='background-size: 133%;'>
    <script>
        window.setTimeout(showVid, 400)
    </script>
    <video id='vid' playsinline='' autoplay='' loop='' muted=''
        style='padding: 11.2191% 0px; height: 88.7809%; width: 100%; display: initial;'>
        <source id='vidsource' src='' type='video/mp4'>
    </video>
</body>

</html>